package com.wave.wavesystem.serve.service.impl;

import com.mybatisflex.core.query.QueryChain;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.wave.common.util.Func;
import com.wave.wavesystem.serve.mapper.LevelMapper;
import com.wave.wavesystem.serve.pojo.entity.Level;
import com.wave.wavesystem.serve.pojo.query.LevelQuery;
import com.wave.wavesystem.serve.service.ILevelService;
import org.springframework.stereotype.Service;


@Service
public class LevelServiceImpl extends ServiceImpl<LevelMapper, Level> implements ILevelService {

    @Override
    public QueryChain<Level> getQueryChain(LevelQuery query) {
        QueryChain<Level> queryChain = queryChain();
        if (Func.isNotEmpty(query.getLevel())) {
            queryChain.eq(Level::getLevel, query.getLevel());
        }
        return queryChain;
    }

}
